package com.aj.http.response;

import org.json.JSONException;
import org.json.JSONObject;

import com.aj.databases.entry.ChildInfo;

public class QueryChildResponse extends BaseRespond {

	private ChildInfo childInfo = new ChildInfo();

	public QueryChildResponse(JSONObject json) {
		super(json);
		try {
			JSONObject resultJSONJsonObject = common.getResult();
			if (resultJSONJsonObject != null) {
				if (!resultJSONJsonObject.isNull("userId")) {
					childInfo.setUserId(resultJSONJsonObject
							.getString("userId"));
				}
				if (!resultJSONJsonObject.isNull("ajNo")) {
					childInfo.setAjNo(resultJSONJsonObject.getString("ajNo"));
				}
				if (!resultJSONJsonObject.isNull("photo")) {
					childInfo.setPhoto(resultJSONJsonObject.getString("photo"));
				}
				if (!resultJSONJsonObject.isNull("nickName")) {
					childInfo.setNickName(resultJSONJsonObject
							.getString("nickName"));
				}
				if (!resultJSONJsonObject.isNull("trueName")) {
					childInfo.setTrueName(resultJSONJsonObject
							.getString("trueName"));
				}
				if (!resultJSONJsonObject.isNull("six")) {
					childInfo.setSix(resultJSONJsonObject.getString("six"));
				}
				if (!resultJSONJsonObject.isNull("birthday")) {
					childInfo.setBirthday(resultJSONJsonObject
							.getString("birthday"));
				}
			}
		} catch (JSONException e) {
			e.printStackTrace();
		}
	}

	public ChildInfo getChildInfo() {
		return childInfo;
	}

	public void setChildInfo(ChildInfo childInfo) {
		this.childInfo = childInfo;
	}

}
